namespace JamesKovacs.Examples.ContractManager {
	/// <summary>
	/// ProductFactory creates <see cref="Product"/> instances.
	/// </summary>
	public class ProductFactory {
		#region Constructors
		private ProductFactory() {
		}
		#endregion

		#region Public implementation
		private readonly ProductFactory s_instance = new ProductFactory();

		/// <summary>
		/// Returns the instance of the ProductFactory singleton.
		/// </summary>
		/// <value>ProductFactory singleton</value>
		public ProductFactory Instance {
			get {
				return s_instance;
			}
		}

		/// <summary>
		/// Creates a new word processor product.
		/// </summary>
		/// <param name="name">Name of the product.</param>
		/// <returns></returns>
		public Product CreateNewWordProcessor(string name) {
			return new Product(name, new CompleteRecognitionStrategy());
		}

		/// <summary>
		/// Creates a new spreadsheet product.
		/// </summary>
		/// <param name="name">Name of the product.</param>
		/// <returns></returns>
		public Product CreateNewSpreadsheet(string name) {
			return new Product(name, new ThreeWayRecognitionStrategy(60, 90));
		}

		/// <summary>
		/// Creates a new database product.
		/// </summary>
		/// <param name="name">Name of the product.</param>
		/// <returns></returns>
		public Product CreateNewDatabase(string name) {
			return new Product(name, new ThreeWayRecognitionStrategy(30, 60));
		}
		#endregion
	}
}
